import { defHttp } from '@/utils/http/axios';
import { ID, IDS } from '@/api/base';
import { ShopInfoVO, ShopInfoForm, ShopInfoQuery } from './model';

/**
 * 查询店铺信息列表
 * @param params
 * @returns
 */
export function shopInfoList(params?: ShopInfoQuery) {
  return defHttp.get<ShopInfoVO[]>({ url: '/shop/shopInfo/list', params });
}

/**
 * 导出店铺信息列表
 * @param params
 * @returns
 */
export function shopInfoExport(params?: ShopInfoQuery) {
  return defHttp.post<Blob>(
    { url: '/shop/shopInfo/export', params, responseType: 'blob' },
    { isTransformResponse: false },
  );
}

/**
 * 查询店铺信息详细
 * @param id id
 * @returns
 */
export function shopInfoInfo(id: ID) {
  return defHttp.get<ShopInfoVO>({ url: '/shop/shopInfo/' + id });
}

/**
 * 新增店铺信息
 * @param data
 * @returns
 */
export function shopInfoAdd(data: ShopInfoForm) {
  return defHttp.postWithMsg<void>({ url: '/shop/shopInfo', data });
}

/**
 * 更新店铺信息
 * @param data
 * @returns
 */
export function shopInfoUpdate(data: ShopInfoForm) {
  return defHttp.putWithMsg<void>({ url: '/shop/shopInfo', data });
}

/**
 * 删除店铺信息
 * @param id id
 * @returns
 */
export function shopInfoRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/shop/shopInfo/' + id });
}
